package org.apache.fop.render.pdf;

import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.render.intermediate.IFContext;
import org.apache.fop.render.intermediate.IFDocumentHandler;
import org.apache.fop.render.pdf.PDFDocumentHandlerMaker;

public class CustomPDFDocumentHandlerMaker extends PDFDocumentHandlerMaker {

    public IFDocumentHandler makeIFDocumentHandler(FOUserAgent ua) {
        CustomPDFDocumentHandler handler = new CustomPDFDocumentHandler();
        handler.setContext(new IFContext(ua));
        if (ua.isAccessibilityEnabled()) {
            ua.setStructureTreeEventHandler(handler.getStructureTreeEventHandler());
        }
        return handler;
    }
}
